class Parametro < ActiveRecord::Base
  validates_presence_of :nome, :valor, :chave
  validates_uniqueness_of :chave

  default_scope :order => :nome

  def self.[](chave)
    find_by_chave(chave.to_s).try(:valor) if chave
  end
end
